package cn.xinfei.xdecision.common.model.component.scriptrule;

import cn.xinfei.xdecision.common.model.BaseDO;
import cn.xinfei.xdecision.common.model.component.ComponentAction;
import cn.xinfei.xdecision.common.model.component.IgnoredParamCheck;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * (RuleScriptVersion)实体类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("`t_rule_script_version`")
public class RuleScriptVersion extends BaseDO implements Serializable {
	@IgnoredParamCheck
    private static final long serialVersionUID = -78864192587533951L;
    /**
     * 规则id
     */
    private Long ruleId;

	/**
	 * 规则code
	 */
	private String ruleCode;

    /**
     * 版本号
     */
    private Long versionNo;
    /**
     * 版本描述
     */
    private String description;
    /**
     * 拒绝分支码
     */
    @IgnoredParamCheck
	@TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long rejectBranchId;
    /**
     * 状态：0:新建，1:锁定
     */
    @IgnoredParamCheck
    private Integer status;

    @IgnoredParamCheck
    @TableField(exist = false)
    private String statusDesc;
    /**
     * 脚本类型：groovy，python，js
     */
    private String scriptType;
    /**
     * 脚本规则集内容json，包含脚本内容和脚本所用字段两个值
     */
    private String scriptContent;

	/**
	 * 脚本依赖的变量codes，多个用逗号分割
	 */
	private String fieldCodes;

    @TableField(exist = false)
    @IgnoredParamCheck
    private String versionNoDesc;

    @IgnoredParamCheck
    @TableField(exist = false)
    private List<ComponentAction> componentActionList = new ArrayList<>();
}
